import { createPinia } from 'pinia';
import { createPersistedState } from 'pinia-plugin-persistedstate';
import type { PluginOptions } from 'pinia-plugin-persistedstate';

export const store = createPinia();

// 本地持久化
store.use(createPersistedState(<PluginOptions>{
  key: (storeKey) => `__persisted_${storeKey}`,
  auto: false,
})
);

export * from './modules/app.ts';

export default store;
